library(shiny)
## how to download other formate of files from shiny app

shinyUI(fluidPage(
  titlePanel(h4("Demonstration of file download using downloadbutton() and downloadHandeler()",
                align = "center")),
  sidebarLayout(
    sidebarPanel(
      selectInput(inputId = "dataset", 
                  label = "Select the dataset", 
                  choices = c("iris", "mtcars", "trees")),
      br(),
      helpText("Select the download format"),
      radioButtons("type","Format type:",
                   choices = c("Excel (CSV)",
                               "Text (TSV)",
                               "Text (Space Separated)",
                               "Doc")),
      br(),
      helpText("Click on the download button to download the dataset observations"),
      downloadButton(outputId = "downloadData",
                     label = 'Download')
    ),
    mainPanel(
      tableOutput("table")
    )
  )
))